<?php


namespace app\index\business;


class Index {
    protected $splitList = [];

    public function getArticleListByCategoryId() {

    }

    public function splitDate($list) {
        foreach ($list as $v) {
            switch ($v ['id']) {
                //轮播图26
                case 26:
                    $this->putDate($v, 'banner');
                    break;
                //重点推荐
//                case 1:
//                    $this->putDate($v, 'zhongDianTuiJian');
//                    break;
                //交易公告
                case 2:
                    $this->putDate($v, 'jiaoYiGongGao');
                    break;
                //成交公示
                case 3:
                    $this->putDate($v, 'chengJiaoGongShi');
                    break;
                //中止终结公告
                case 10:
                    $this->putDate($v, 'zhongZhiGongGao');
                    break;
                //采购公告
                case 4:
                    $this->putDate($v, 'caiGouGongGao');
                    break;
                //其他公告
                case 9:
                    $this->putDate($v, 'qiTaGongGao');
                    break;
            }
        }
        return $this->splitList;
    }

    public function putDate($v, $name) {

        $this->splitList[$name] = [
            'category_id' => $v['id'],
            'category_name' => $v['name'],
            'data' => $v['articles']
        ];
    }
}